import sys
from Dataloader.twitterloader import SentiReader
from Dataloader.dataloader_utils import shuffle_data
from Dataloader.twitterloader import TwitterSet

events = ['../../pheme-rnr-dataset/charliehebdo',
          '../../pheme-rnr-dataset/ferguson',
          '../../pheme-rnr-dataset/germanwings-crash',
          '../../pheme-rnr-dataset/ottawashooting',
          '../../pheme-rnr-dataset/sydneysiege']
for i in range(len(events)):
    tr_set = TwitterSet()
    tr_set.load_event_list([events[j] for j in range(len(events)) if j !=i], cached_pkl_file="../data/pheme.pkl")
    dev_te = TwitterSet()
    dev_te.load_event_list([events[i]],cached_pkl_file="../data/pheme.pkl")
    dev, te = dev_te.BalancedSplit([len(dev_te)//2, len(dev_te)])
    tr_set.Caches_Data(f"../data/twitter_tr{i}")
    dev.Caches_Data(f"../data/twitter_dev{i}")
    te.Caches_Data(f"../data/twitter_te{i}")
    # for FS in [20, 40, 60, 80, 100]:
    #     dev, te = dev_te.BalancedSplit([FS, len(dev_te)])
    #     tr_set.Caches_Data(f"../data/twitter_od{i}_{FS}")
    #     dev.Caches_Data(f"../data/twitter_fs{i}_{FS}")
    #     te.Caches_Data(f"../data/twitter_nd{i}_{FS}")